/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jalarbee.liquid.services.business;

import com.jalarbee.core.money.MonetaryAmount;
import com.jalarbee.stock.category.business.Category;
import java.io.Serializable;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import org.hibernate.annotations.Columns;
import org.hibernate.annotations.Type;

/**
 *
 * @author Abdoul
 */

@Entity
public class Service implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;
    private String name;
    private String description;
    @ManyToOne(optional = false, cascade = {CascadeType.MERGE, CascadeType.REMOVE})
    @JoinColumn(name = "CATEGORY_ID", nullable = false)
    private Category category;
    @Type(type = "com.jalarbee.core.money.MonetaryAmountType")
    @Columns(columns = {
        @Column(name = "s_currency"),
        @Column(name = "s_amount")})
    private MonetaryAmount stockPrice;
    @Type(type = "com.jalarbee.core.money.MonetaryAmountType")
    @Columns(columns = {
        @Column(name = "r_currency"),
        @Column(name = "r_amount")})
    private MonetaryAmount retailPrice;
    @Type(type = "com.jalarbee.core.money.MonetaryAmountType")
    @Columns(columns = {
        @Column(name = "c_currency"),
        @Column(name = "c_amount")})
    private MonetaryAmount creditPrice;

    public Service() {
    }

    public Category getCategory() {
        return category;
    }

    public void setCategory(Category category) {
        this.category = category;
    }

    public MonetaryAmount getCreditPrice() {
        return creditPrice;
    }

    public void setCreditPrice(MonetaryAmount creditPrice) {
        this.creditPrice = creditPrice;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public MonetaryAmount getRetailPrice() {
        return retailPrice;
    }

    public void setRetailPrice(MonetaryAmount retailPrice) {
        this.retailPrice = retailPrice;
    }

    public MonetaryAmount getStockPrice() {
        return stockPrice;
    }

    public void setStockPrice(MonetaryAmount stockPrice) {
        this.stockPrice = stockPrice;
    }
    
    
}
